// pages/news-info/news-info.js
import {News} from '../news/news-model.js';
var WxParse = require('../../wxParse/wxParse.js');
var news = new News();
Page({

  /**
   * 页面的初始数据
   */
  data: {
  
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (option) {
    var id = option.id;
    this.data.id = id;
    this._loadData();
  },

  _loadData: function (callback) {
    var that = this;
    news.getDetailInfo(this.data.id, (data) => {
      var content = data.content;
      WxParse.wxParse('content', 'html', content, that, 5);
      that.setData({
        newsData: data
      })
    })
  },
})